//
//  NSString+GXSizeWithText.m
//  GXInformationDemo
//
//  Created by 甘霞 on 15/10/22.
//  Copyright © 2015年 甘霞. All rights reserved.
//

#import "NSString+GXSizeWithText.h"


@implementation NSString (GXSizeWithText)

- (CGRect)SizeWithTextFontSize:(CGFloat)fontSize textWidth:(CGFloat)width {
    
    NSDictionary *fontDic = @{NSFontAttributeName : [UIFont systemFontOfSize:fontSize]};
    CGRect size = [self boundingRectWithSize:CGSizeMake(width, 100) options:NSStringDrawingUsesLineFragmentOrigin attributes:fontDic context:nil];
    return size;
}

@end
